 <%@ page language="java" contentType="text/javascript; charset=UTF-8"
	pageEncoding="UTF-8"%>  

function fnLogin(){
    	var oUname = document.getElementById("uname");
    	var oUpass = document.getElementById("upass");
    	var oError = document.getElementById("error_box");
    	var isNotError = true;
    	if(oUname.value.length > 20 || oUname.value.length < 6){
    		oError.innerHTML = "用户名长度必须在6~20位之间";
    		isNotError = false;
    		return;
    		
    	}else if(oUname.value.charCodeAt(0) >= 48 && oUname.value.charCodeAt(0) <= 57){
    		oError.innerHTML = "用户名开头不能为数字";
    		isNotError = false;
    		return;
    	}else{
    		for(var i=0; i<oUname.value.length; i++){
    			if((oUname.value.charCodeAt(i) > 122 || oUname.value.charCodeAt(i) < 97) && (oUname.value.charCodeAt(i) > 57 || oUname.value.charCodeAt(i) < 48)){
    				oError.innerHTML = "用户名只能包含小写字母和数字";
    				isNotError = false;
    				return;
    			}
    		}
    	}
    	if(oUpass.value.length > 20 || oUpass.value.length < 6){
    		oError.innerHTML = "密码长度必须在6~20位之间";
    		isNotError = false;
    		return;
    	}else if(isNotError){

            $("form").submit(function() {
                $.utils4b().addShade(null,$(document).width(),$(document).height(),($(window).height() - 100) * 0.5, ($(window).width() - 100) * 0.5);
        });
       
    	}
    }
    
    if(document != top.document) {
        top.document.location.href = "";
    }

    $(document).ready(function(){
    	$("#verify").click(function(){
			var url = "${pageContext.request.contextPath}/login/authcode.do?timestamp="+new Date().getTime();
			$(this).attr("src", url);
		});
		$("#verify").click();
    });
    
